package com.yuanfengerp.inventory.controller;


import com.yuanfengerp.inventory.entity.WarehouseTransfer;
import com.yuanfengerp.inventory.service.IWarehouseTransferService;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/warehouseTransfer")
public class WarehouseTransferController {
    @Autowired
    private IWarehouseTransferService iwts;

    @GetMapping("/queryWarehouseTransfer")
    public Result<List<WarehouseTransfer>> queryWarehouseTransfer(@RequestBody Map<String, Object> params) {
        return iwts.queryWarehouseTransfer(params);
    }

    @PostMapping("/addWarehouseTransfer")
    public Result<String> addWarehouseTransfer(@RequestBody WarehouseTransfer warehouseTransfer) {
        return iwts.addWarehouseTransfer(warehouseTransfer);
    }

    @GetMapping("/queryWarehouseTransferById")
    public Result<WarehouseTransfer> queryWarehouseTransferById(@RequestBody String warehouse_document_number) {
        System.out.println("warehouse_document_number:" + warehouse_document_number);
        return iwts.queryWarehouseTransferById(warehouse_document_number);
    }

    @PostMapping("/updateWarehouseTransfer")
    public Result<String> updateWarehouseTransfer(@RequestBody WarehouseTransfer warehouseTransfer) {
        return iwts.updateWarehouseTransfer(warehouseTransfer);
    }

    @PostMapping("/updateWarehouseTransferAgree")
    public Result<String> updateWarehouseTransferAgree(String warehouse_document_number) {
        System.out.println(warehouse_document_number);
        return iwts.updateWarehouseTransferAgree(warehouse_document_number);
    }

    @PostMapping("/updateWarehouseTransferRefuse")
    public Result<String> updateWarehouseTransferRefuse(String warehouse_document_number) {
        System.out.println(warehouse_document_number);
        return iwts.updateWarehouseTransferRefuse(warehouse_document_number);
    }

    @PostMapping("/deleteWarehouseTransfer")
    public Result<String> deleteWarehouseTransfer(String warehouse_document_number) {
        return iwts.deleteWarehouseTransfer(warehouse_document_number);
    }
    @PostMapping("/updateWarehouseTransferPartialReceipt")
    public Result<String> updateWarehouseTransferPartialReceipt(String warehouse_document_number) {
        return iwts.updateWarehouseTransferPartialReceipt(warehouse_document_number);
    }
    @PostMapping("/updateWarehouseTransferReceipt")
    public Result<String> updateWarehouseTransferReceipt(String warehouse_document_number) {
        return iwts.updateWarehouseTransferReceipt(warehouse_document_number);
    }
}

